<?
	class URLParams{
		function URLParams($rpath){
			$this->__a=explode("/",$rpath);
			$this->__p = array_values(array_filter(explode("/",getsys("tail_urlpath"))));
		}
		
		function __init(){
			foreach($this->__p as $i=>$node){
				$n = $this->__a[$i];
				if(ereg("^:(.*)",$n,$m)){
					$this->__params[$m[1]]=$node;
				}
			}
		}
		
		function count(){
			if(!isset($this->__params)) $this->__init();
			return count($this->__params);
		}
		
		function __get($name, &$value){ 
			if(!isset($this->__params)) $this->__init();
			//var_dump($this->__params);
			$value=$this->__params[$name];
			return true;
		}
	}
	overload("URLParams");
	
?>
